﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="CadastroCusto.aspx.cs" Inherits="NewTierra.Pages.Financeiro.CadastroCusto" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title></title>
    <link rel="shortcut icon" href="../../images/Icones/favicon.ico" type="image/x-icon" />

    <link href="../../Styles/jquery_notification.css" rel="stylesheet" />

    <link href="../../Styles/jquery-ui.css" rel="stylesheet" />    
    <script type="text/javascript" src="../../Scripts/jquery-1.11.0.js"></script>
    <script type="text/javascript" src="../../Scripts/jquery-ui-1.10.0.js"></script>


    <script type="text/javascript" src="../../Scripts/jquery_notification_v.1.js"></script>

    <link href="~/Styles/EstiloGeral.css" rel="stylesheet" type="text/css" />


</head>
<body>

    <style type="text/css">
        .ModalPopupBG {
            background-color: gray;
            filter: alpha(opacity=60);
            opacity: 0.7;
        }

        .ModalPopup {
            border: 1px solid #E6E6E6;
            background-color: #fff;
            padding: 3px;
        }


        .CadBox_grid {
            height: 490px;
            width: 1245px;
            overflow-x: auto;
            overflow-y: auto;
        }

        .Consulta {
            height: auto;
            width: auto;
            border: 1px solid #d9d9d9;
            background: #f9f9f9;
        }

        .ConsultaIncluir {
            height: auto;
            border: 1px solid #d9d9d9;
            background: #f9f9f9;
            float: left;
        }

        .Tarifas {
            height: 353px;
            width: 1317px;
            float: left;
            overflow-x: auto;
            overflow-y: auto;
        }

        .tabConferencia {
            height: 175px;
        }

        .invisible {
            display: none;
        }

        .ChildGrid td {
            background-color: #eee !important;
            color: black;
            font-size: 10pt;
            line-height: 200%;
        }

        .ChildGrid th {
            background-color: #6C6C6C !important;
            color: White;
            font-size: 10pt;
            line-height: 200%;
        }

        #direita {
            float: right;
        }

        #esquerda {
            float: left;
        }

        #tabs {
            height: 600px;
        }

        #lblCancelada {
            font-size: large;
            color: red;
        }
    </style>

    <script>
        jQuery(function ($) {
            $.datepicker.regional['pt-BR'] = {
                closeText: 'Fechar',
                prevText: '&#x3c;Anterior',
                nextText: 'Pr&oacute;ximo&#x3e;',
                currentText: 'Hoje',
                monthNames: ['Janeiro', 'Fevereiro', 'Mar&ccedil;o', 'Abril', 'Maio', 'Junho',
             'Julho', 'Agosto', 'Setembro', 'Outubro', 'Novembro', 'Dezembro'],
                monthNamesShort: ['Jan', 'Fev', 'Mar', 'Abr', 'Mai', 'Jun',
             'Jul', 'Ago', 'Set', 'Out', 'Nov', 'Dez'],
                dayNames: ['Domingo', 'Segunda-feira', 'Ter&ccedil;a-feira', 'Quarta-feira', 'Quinta-feira', 'Sexta-feira', 'Sabado'],
                dayNamesShort: ['Dom', 'Seg', 'Ter', 'Qua', 'Qui', 'Sex', 'Sab'],
                dayNamesMin: ['Dom', 'Seg', 'Ter', 'Qua', 'Qui', 'Sex', 'Sab'],
                weekHeader: 'Sm',
                dateFormat: 'dd/mm/yy',
                firstDay: 0,
                isRTL: false,
                showMonthAfterYear: false,
                yearSuffix: ''
            };
            $.datepicker.setDefaults($.datepicker.regional['pt-BR']);

        });

        function jScript() {
            $("#tabs").tabs();

            $("input[id$=dtEmissao]").datepicker({
                defaultDate: "+1w",
                changeMonth: true,
                changeYear: true,
                numberOfMonths: 1,
                onClose: function (selectedDate) {
                    $("input[id$=dtVencimento]").datepicker("option", "minDate", selectedDate);
                }
            });
            $("input[id$=dtVencimento]").datepicker({
                defaultDate: "+1w",
                changeMonth: true,
                changeYear: true,
                numberOfMonths: 1,
                onClose: function (selectedDate) {
                    $("input[id$=dtEmissao]").datepicker("option", "maxDate", selectedDate);
                }
            });


            $("#dtPagamento").datepicker();
            $("#dtData").datepicker();
            $("#txtDataInicial").datepicker();
            $("#txtDataFinal").datepicker();
            $("#txtDataPagamentoPagarFatura").datepicker();
            $("#txtDataConciliacao").datepicker();




            $("#txtDataInicialContasPagarRelatorios").datepicker();
            $("#txtDataFinalContasPagarRelatorios").datepicker();

            $("#txtDataIncialModalRelatorioConciliacao").datepicker();
            $("#txtDataFinalModalRelatorioConciliacao").datepicker();

            $("#txtDataCambio").datepicker();




        }

        function SetKey() {
            $find('<%=AutoCompleteExtender1.ClientID%>').set_contextKey($get("<%=txtS_id.ClientID %>").value);
        }

        function SetKeySupplierConferencia() {

            var e = document.getElementById("ckTodasFaturas");

            $find('<%=AutoCompleteExtender3.ClientID%>').set_contextKey($get("<%=txtSupplierConferencia_id.ClientID %>").value + "," + e.checked);
        }

        function SetKeyInvoiceConferencia() {

            var e = document.getElementById("ckTodasFaturas");

            $find('<%=AutoCompleteExtender4.ClientID%>').set_contextKey($get("<%=txtSupplierConferencia_id.ClientID %>").value + "," + e.checked);
            $find('<%=AutoCompleteExtender3.ClientID%>').set_contextKey($get("<%=txtInvoiceConferencia_id.ClientID %>").value);
        }

        function SetCheckBoxTotasFaturas() {

            var e = document.getElementById("ckTodasFaturas");
            alert("passou aqui " + document.getElementById("ckTodasFaturas").checked);

            if (e.checked) {
                alert("passou aqui 2");
            }

        }


        function CallServerSupplier() {
            document.getElementById('<%= btnFiltroNomeSupplier.ClientID %>').click();
        }

        function ShowIcon() {
            var e = document.getElementById("processing");
            e.style.visibility = (e.style.visibility == 'visible') ? 'hidden' : 'visible';
        }

        function CallServerFatura() {
            document.getElementById('<%= btnFiltroNumeroFatura.ClientID %>').click();
        }

        function ShowIcon2() {
            var e = document.getElementById("processing2");
            e.style.visibility = (e.style.visibility == 'visible') ? 'hidden' : 'visible';
        }

        function ShowIcon3() {
            var e = document.getElementById("processing3");
            e.style.visibility = (e.style.visibility == 'visible') ? 'hidden' : 'visible';
        }

        function CallServerSupplierConferencia() {
            document.getElementById('<%= btnFiltroNomeSupplierConferencia.ClientID %>').click();
        }

        function CallServerFaturaConferencia() {
            document.getElementById('<%= btnFiltroNumeroFaturaConferencia.ClientID %>').click();
        }

        function CallServerFile() {
            document.getElementById('<%= btnFiltroFileNbr.ClientID %>').click();
        }


        function CallServerBanco() {
            document.getElementById('<%= btnFiltroBanco.ClientID %>').click();
        }

        function CallServerAgencia() {
            document.getElementById('<%= btnFiltroAgencia.ClientID %>').click();
        }

        function CallServerConta() {
            document.getElementById('<%= btnFiltroConta.ClientID %>').click();
        }





        function CallServerBancoConciliacao() {
            document.getElementById('<%= btnFiltroBancoConciliacao.ClientID %>').click();
        }

        function CallServerAgenciaConciliacao() {
            document.getElementById('<%= btnFiltroAgenciaConciliacao.ClientID %>').click();
        }

        function CallServerContaConciliacao() {
            document.getElementById('<%= btnFiltroContaConciliacao.ClientID %>').click();
        }




        function moeda(z) {
            v = z.value;
            v = v.replace(/\D/g, "")  //permite digitar apenas números
            v = v.replace(/[0-9]{12}/, "inválido")   //limita pra máximo 999.999.999,99
            v = v.replace(/(\d{1})(\d{8})$/, "$1.$2")  //coloca ponto antes dos últimos 8 digitos
            v = v.replace(/(\d{1})(\d{5})$/, "$1.$2")  //coloca ponto antes dos últimos 5 digitos
            v = v.replace(/(\d{1})(\d{1,2})$/, "$1,$2")	//coloca virgula antes dos últimos 2 digitos
            z.value = v;
        }






        function DesbloquearTela() {
            if (!document.getElementById("txtInvoice").value == "") {

                document.getElementById("txtInvoice").disabled = true;
                document.getElementById("txtMulta").disabled = false;
                document.getElementById("txtVrTotServ").disabled = false;
                document.getElementById("txtNumeroBanco").disabled = false;
                document.getElementById("txtAgencia").disabled = false;
                document.getElementById("txtConta").disabled = false;
                document.getElementById("dtEmissao").disabled = false;
                document.getElementById("dtVencimento").disabled = false;
                document.getElementById("txtDescontos").disabled = false;
                document.getElementById("txtObsDescontos").disabled = false;
                document.getElementById("txtMoraDia").disabled = false;
                document.getElementById("txtComissoes").disabled = false;
                document.getElementById("txtObsComissoes").disabled = false;
                document.getElementById("txtMoraDiaR").disabled = false;
                document.getElementById("txtTotPagar").disabled = false;
                document.getElementById("txtImpostos").disabled = false;
                document.getElementById("txtObsImpostos").disabled = false;
                document.getElementById("cmbMoeda").disabled = false;
                document.getElementById("cmbCentroCusto").disabled = false;
                document.getElementById("cmbClassificacaoContabil").disabled = false;
                document.getElementById("cmbTipoFatura").disabled = false;

                document.getElementById("dtEmissao").focus();
            } else {
                document.getElementById("txtInvoice").focus();
            }

        }

        function divexpandcollapse2(divname, nome) {
            var div = document.getElementById(divname);
            div.style.display = "inline";
            var img = document.getElementById('img' + divname);
            img.src = "../../images/minus-small.png";

            var nome = document.getElementById(nome);
            nome.focus();
        }


        function divexpandcollapse3(divname) {
            var div = document.getElementById(divname);
            div.style.display = "inline";
            var img = document.getElementById('img' + divname);
            img.src = "../../images/minus-small.png";
        }



        function divexpandcollapse(divname) {
            var div = document.getElementById(divname);
            var img = document.getElementById('img' + divname);
            if (div.style.display == "none") {
                div.style.display = "inline";
                img.src = "../../images/minus-small.png";
            } else {
                div.style.display = "none";
                img.src = "../../images/plus-small.png";
            }
        }

    </script>

    <form id="form1" runat="server">


        <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>

        <script type="text/javascript">
            function showAutoCloseMessage(MsgsExc) {
                showNotification({
                    message: MsgsExc,
                    autoClose: true,
                    type: "success",
                    duration: 5
                });
            }


        </script>


        <div class="bgHeader">

            <div class="bgHeader_into">
                <asp:ImageButton ID="ImgVoltarMenu" OnClick="VoltarMenu" runat="server" ImageUrl="~/images/Icones/iconeMenu2.png" ToolTip="Menu" />
            </div>

            <div class="bgHeader_into" style="width: 250px;">

                <asp:Label ID="lblSupplierHeader" runat="server" Text="Cadastro de Faturas" CssClass="titulo" />

            </div>

        </div>

        <div id="CadastroCusto">
            <div id="tabs">
                <ul>
                    <li><a href="#tabs-1">Incluir Fatura</a></li>
                    <li><a href="#tabs-2">Conferencia</a></li>
                    <li><a href="#tabs-3">Baixa de Faturas</a></li>
                    <li><a href="#tabs-4">Conciliação Bancaria</a></li>
                    <li><a href="#tabs-5">Cambio</a></li>
                    <li><a href="#tabs-6">Relatorio</a></li>
                    <li><a href="#tabs-7">Tabelas</a></li>
                </ul>


                <div id="tabs-1">
                    <asp:UpdatePanel runat="server" ID="updTab1">
                        <ContentTemplate>
                            <script type="text/javascript" language="javascript">
                                Sys.Application.add_load(jScript);
                            </script>



                            <div class="ConsultaIncluir radius">
                                <table style="float: left; width: 690px;">

                                    <tr>
                                        <td>
                                            <asp:Label ID="lblSupplier" runat="server" Text="Supplier:" />
                                        </td>
                                        <td colspan="6">
                                            <asp:TextBox ID="txtSupplier" runat="server" Width="425" />
                                            <img id="processing" alt="load" style="visibility: hidden" src="../../images/ajax-loader.gif" />

                                            <asp:Button ID="btnFiltroNomeSupplier" Style="display: none" runat="server" Text="" OnClick="btnFiltroNomeSupplier_Click" />
                                            <asp:AutoCompleteExtender
                                                ServiceMethod="SearchSuppliers"
                                                MinimumPrefixLength="1"
                                                CompletionInterval="100"
                                                EnableCaching="False"
                                                TargetControlID="txtSupplier"
                                                OnClientPopulating="ShowIcon"
                                                OnClientPopulated="ShowIcon"
                                                ID="AutoCompleteExtenderQuoteNumber" runat="server"
                                                OnClientItemSelected="CallServerSupplier"
                                                DelimiterCharacters=""
                                                Enabled="True">
                                            </asp:AutoCompleteExtender>

                                            <asp:TextBox ID="txtS_id" runat="server"  style="display:none"></asp:TextBox>

                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <asp:Label ID="lblInvoice" runat="server" Text="Número da Fatura:" />
                                        </td>
                                        <td>
                                            <asp:TextBox ID="txtInvoice" runat="server" OnTextChanged="txtInvoice_TextChanged" AutoPostBack="true" onkeyup="SetKey()" />
                                            <asp:Button ID="btnFiltroNumeroFatura" Style="display: none" runat="server" Text="" OnClick="btnFiltroNumeroFatura_Click" />
                                            <asp:AutoCompleteExtender
                                                ServiceMethod="SearchFatura"
                                                MinimumPrefixLength="1"
                                                CompletionInterval="100"
                                                EnableCaching="False"
                                                TargetControlID="txtInvoice"
                                                ID="AutoCompleteExtender1" runat="server"
                                                OnClientItemSelected="CallServerFatura"
                                                DelimiterCharacters=""
                                                Enabled="True" UseContextKey="true">
                                            </asp:AutoCompleteExtender>

                                            <asp:TextBox ID="txtInvoice_id" runat="server"  style="display:none"></asp:TextBox>

                                        </td>
                                        <td>
                                            <asp:Label ID="lblDescontos" runat="server" Text="Descontos(-):" />
                                        </td>
                                        <td>
                                            <asp:TextBox ID="txtDescontos" runat="server" CssClass="TextBoxsPequeno" AutoPostBack="true" OnTextChanged="recalcularValorIncluirFatura" />
                                            <asp:RegularExpressionValidator ID="ReDescontoss" runat="server" ErrorMessage="*" CssClass="MsgErro" ControlToValidate="txtDescontos" ToolTip="Somente valores numericos" ValidationExpression="^[+-]?[0-9]{1,3}(?:[0-9]*(?:[.,][0-9]{2})?|(?:,[0-9]{3})*(?:\.[0-9]{2})?|(?:\.[0-9]{3})*(?:,[0-9]{2})?)$"></asp:RegularExpressionValidator>
                                        </td>
                                    </tr>

                                    <tr>
                                        <td>
                                            <asp:Label ID="lblEmissao" runat="server" Text="Data Emissão:" />
                                        </td>
                                        <td>
                                            <asp:TextBox ID="dtEmissao" runat="server" CssClass="TextBoxsPequeno" />
                                        </td>
                                        <td>
                                            <asp:Label ID="lblComissoes" runat="server" Text="Comissões(-):" />
                                        </td>
                                        <td>
                                            <asp:TextBox ID="txtComissoes" runat="server" CssClass="TextBoxsPequeno" AutoPostBack="true" OnTextChanged="recalcularValorIncluirFatura" />
                                            <asp:RegularExpressionValidator ID="ReComissoes" runat="server" ErrorMessage="*" CssClass="MsgErro" ControlToValidate="txtComissoes" ToolTip="Somente valores numericos" ValidationExpression="^[+-]?[0-9]{1,3}(?:[0-9]*(?:[.,][0-9]{2})?|(?:,[0-9]{3})*(?:\.[0-9]{2})?|(?:\.[0-9]{3})*(?:,[0-9]{2})?)$"></asp:RegularExpressionValidator>
                                        </td>
                                    </tr>

                                    <tr>

                                        <td>
                                            <asp:Label ID="lblVencimento" runat="server" Text="Data Vencimento:" />
                                        </td>
                                        <td>
                                            <asp:TextBox ID="dtVencimento" runat="server" CssClass="TextBoxsPequeno" />
                                        </td>

                                        <td>
                                            <asp:Label ID="lblImpostos" runat="server" Text="Impostos(+):" />
                                        </td>
                                        <td>
                                            <asp:TextBox ID="txtImpostos" runat="server" CssClass="TextBoxsPequeno" AutoPostBack="true" OnTextChanged="recalcularValorIncluirFatura" />
                                            <asp:RegularExpressionValidator ID="ReImpostos" runat="server" ErrorMessage="*" CssClass="MsgErro" ControlToValidate="txtImpostos" ToolTip="Somente valores numericos" ValidationExpression="^[+-]?[0-9]{1,3}(?:[0-9]*(?:[.,][0-9]{2})?|(?:,[0-9]{3})*(?:\.[0-9]{2})?|(?:\.[0-9]{3})*(?:,[0-9]{2})?)$"></asp:RegularExpressionValidator>
                                        </td>
                                    </tr>


                                    <tr>
                                        <td>
                                            <asp:Label ID="lblVrTotServ" runat="server" Text="Valor Bruto:" />
                                        </td>
                                        <td>
                                            <asp:TextBox ID="txtVrTotServ" runat="server" CssClass="TextBoxsPequeno" AutoPostBack="true" OnTextChanged="recalcularValorIncluirFatura" />
                                            <asp:RegularExpressionValidator ID="ReVrTotServ" runat="server" ErrorMessage="*" CssClass="MsgErro" ControlToValidate="txtVrTotServ" ToolTip="Somente valores numericos" ValidationExpression="^[+-]?[0-9]{1,3}(?:[0-9]*(?:[.,][0-9]{2})?|(?:,[0-9]{3})*(?:\.[0-9]{2})?|(?:\.[0-9]{3})*(?:,[0-9]{2})?)$"></asp:RegularExpressionValidator>
                                        </td>
                                        <td>
                                            <asp:Label ID="lblValorLiquido" runat="server" Text="Valor Liquido:" />
                                        </td>
                                        <td>
                                            <asp:TextBox ID="txtValorLiquido" runat="server" CssClass="TextBoxsPequeno" onKeyUp="moeda(this);" />
                                            <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ErrorMessage="*" CssClass="MsgErro" ControlToValidate="txtValorLiquido" ToolTip="Somente valores numericos" ValidationExpression="^[+-]?[0-9]{1,3}(?:[0-9]*(?:[.,][0-9]{2})?|(?:,[0-9]{3})*(?:\.[0-9]{2})?|(?:\.[0-9]{3})*(?:,[0-9]{2})?)$"></asp:RegularExpressionValidator>
                                        </td>
                                    </tr>

                                    <tr>
                                        <td>
                                            <asp:Label ID="lblMoraDiaR" runat="server" Text="Mora Dia R$:" />
                                        </td>
                                        <td>
                                            <asp:TextBox ID="txtMoraDiaR" runat="server" CssClass="TextBoxsPequeno" />
                                            <asp:RegularExpressionValidator ID="ReMoraDiaR" runat="server" ErrorMessage="*" CssClass="MsgErro" ControlToValidate="txtMoraDiaR" ToolTip="Somente valores numericos" ValidationExpression="^[+-]?[0-9]{1,3}(?:[0-9]*(?:[.,][0-9]{2})?|(?:,[0-9]{3})*(?:\.[0-9]{2})?|(?:\.[0-9]{3})*(?:,[0-9]{2})?)$"></asp:RegularExpressionValidator>
                                        </td>
                                        <td>
                                            <asp:Label ID="lblMoraDia" runat="server" Text="Mora:" />
                                        </td>
                                        <td>
                                            <asp:TextBox ID="txtMoraDia" runat="server" CssClass="TextBoxsPequeno" AutoPostBack="true" OnTextChanged="recalcularValorIncluirFatura" />
                                            <asp:RegularExpressionValidator ID="ReMoraDia" runat="server" ErrorMessage="*" CssClass="MsgErro" ControlToValidate="txtMoraDia" ToolTip="Somente valores numericos" ValidationExpression="^[+-]?[0-9]{1,3}(?:[0-9]*(?:[.,][0-9]{2})?|(?:,[0-9]{3})*(?:\.[0-9]{2})?|(?:\.[0-9]{3})*(?:,[0-9]{2})?)$"></asp:RegularExpressionValidator>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td></td>
                                        <td></td>
                                        <td>
                                            <asp:Label ID="lblMulta" runat="server" Text="Multa" />
                                        </td>
                                        <td>
                                            <asp:TextBox ID="txtMulta" runat="server" AutoPostBack="true" OnTextChanged="recalcularValorIncluirFatura" />
                                            <asp:RegularExpressionValidator ID="ReMulta" runat="server" ErrorMessage="*" CssClass="MsgErro" ControlToValidate="txtMulta" ToolTip="Somente valores numericos" ValidationExpression="^[+-]?[0-9]{1,3}(?:[0-9]*(?:[.,][0-9]{2})?|(?:,[0-9]{3})*(?:\.[0-9]{2})?|(?:\.[0-9]{3})*(?:,[0-9]{2})?)$"></asp:RegularExpressionValidator>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td></td>
                                        <td></td>
                                        <td>
                                            <asp:Label ID="lblTotPagar" runat="server" Text="Vr Tot pagar:" />
                                        </td>
                                        <td>
                                            <asp:TextBox ID="txtTotPagar" runat="server" CssClass="TextBoxsPequeno" onKeyUp="moeda(this);" />
                                            <asp:RegularExpressionValidator ID="ReTotPagar" runat="server" ErrorMessage="*" CssClass="MsgErro" ControlToValidate="txtTotPagar" ToolTip="Somente valores numericos" ValidationExpression="^[+-]?[0-9]{1,3}(?:[0-9]*(?:[.,][0-9]{2})?|(?:,[0-9]{3})*(?:\.[0-9]{2})?|(?:\.[0-9]{3})*(?:,[0-9]{2})?)$"></asp:RegularExpressionValidator>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <asp:Label ID="lblMoeda" runat="server" Text="Moeda:" />
                                        </td>
                                        <td>
                                            <asp:DropDownList ID="cmbMoeda" runat="server" />
                                        </td>

                                        <td>
                                            <asp:Label ID="lblCentroCusto" runat="server" Text="Centro de Custo:" />
                                        </td>
                                        <td>
                                            <asp:DropDownList ID="cmbCentroCusto" runat="server" />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <asp:Label ID="lblClassificacaoContabil" runat="server" Text="Classificação Contábil:" />
                                        </td>
                                        <td>
                                            <asp:DropDownList ID="cmbClassificacaoContabil" runat="server" />
                                        </td>
                                        <td>
                                            <asp:Label ID="lblTipoFatura" runat="server" Text="Tipo Fatura:" />
                                        </td>
                                        <td>
                                            <asp:DropDownList ID="cmbTipoFatura" runat="server" />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <asp:Label ID="lblObsGeral" Text="Observação:" runat="server" />
                                        </td>
                                        <td colspan="3">
                                            <asp:TextBox ID="txtObsGeral" MaxLength="1000" runat="server" Height="100" Width="500px" TextMode="MultiLine" />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <asp:Label ID="lblCancelada" Text="" runat="server" />

                                        </td>
                                        <td colspan="3">
                                            <asp:Button ID="btnSalvar" runat="server" Text="Salvar" CssClass="btnGeralAzul" OnClick="btnSalvar_Click" />
                                            <asp:Button ID="btnNovo" runat="server" Text="Nova Fatura" CssClass="btnGeralAzul" OnClick="btnNovo_Click" />
                                            <asp:Button ID="btnCancelarFatura" runat="server" Text="Cancelar Fatura" CssClass="btnGeralAzul" OnClick="btnCancelarFatura_Click" />
                                        </td>
                                    </tr>
                                </table>
                            </div>
                            <caption>
                                <fieldset style="border-radius: 10px; width: 580px; float: right;">
                                    <legend>
                                        <caption>
                                            <h3>Info Pagamento</h3>
                                        </caption>
                                    </legend>
                                    <table style="float: left">
                                        <tr>
                                            <td>
                                                <asp:Label ID="lblNumeroBanco" runat="server" Text="Nome do Banco:" />
                                            </td>
                                            <td colspan="3">
                                                <asp:TextBox ID="txtNumeroBanco" runat="server" CssClass="TextBoxsPequeno" Width="383px" />
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <asp:Label ID="lblAgencia" runat="server" Text="Agencia:" />
                                            </td>
                                            <td>
                                                <asp:TextBox ID="txtAgencia" runat="server" CssClass="TextBoxsPequeno" />
                                            </td>
                                            <td>
                                                <asp:Label ID="lblConta" runat="server" Text="Conta:" />
                                            </td>
                                            <td>
                                                <asp:TextBox ID="txtConta" runat="server" CssClass="TextBoxsPequeno" />
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <asp:Label ID="lblDataPagamento" runat="server" Text="Data Pagamento:" />
                                            </td>
                                            <td>
                                                <asp:TextBox ID="txtDataPagamento" runat="server" CssClass="TextBoxsPequeno" Enabled="false" />
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <asp:Label ID="lblFTC" runat="server" Text="FTC: " />
                                                <asp:CheckBox ID="ckFTC" runat="server" Text="" />
                                            </td>
                                            <td>
                                                <asp:Label ID="lblFPC" runat="server" Text="FPC: " />
                                                <asp:CheckBox ID="ckFPC" runat="server" Text="" />
                                            </td>
                                        </tr>
                                    </table>
                                </fieldset>

                                <fieldset style="border-radius: 10px; width: 580px; float: right;">
                                    <legend>
                                        <caption>
                                            <h3>Info Conferencia</h3>
                                        </caption>
                                    </legend>

                                    <div style="width: auto">
                                        <asp:GridView ID="gridInfoConferencia" runat="server" CssClass="mGrid" AutoGenerateColumns="false" GridLines="None">
                                            <AlternatingRowStyle CssClass="alt" />
                                            <Columns>

                                                <asp:BoundField DataField="numeroFile" HeaderText="File" ItemStyle-Width="300" />
                                                <asp:BoundField DataField="valorReaisTotal" HeaderText="Valor" ItemStyle-Width="300" />

                                            </Columns>
                                        </asp:GridView>
                                    </div>

                                </fieldset>

                            </caption>

                            <table>




                                <tr>
                                    <td>
                                        <asp:Label ID="lblPagamento" runat="server" Text="Data Pagamento:" />
                                    </td>
                                    <td>
                                        <asp:TextBox ID="dtPagamento" runat="server" CssClass="TextBoxsPequeno" />
                                    </td>
                                    <td>
                                        <asp:Label ID="lblCambio" runat="server" Text="Câmbio:" />
                                    </td>
                                    <td>
                                        <asp:TextBox ID="txtCambio" runat="server" CssClass="TextBoxsPequeno" />
                                    </td>

                                    <td>
                                        <asp:Label ID="lblDeposito" runat="server" Text="Deposito(-):" />
                                    </td>
                                    <td>
                                        <asp:TextBox ID="txtDeposito" runat="server" CssClass="TextBoxsPequeno" />
                                    </td>
                                    <td>
                                        <asp:Label ID="lblObsDeposito" runat="server" Text="OBS:" />
                                    </td>
                                    <td>
                                        <asp:TextBox ID="txtObsDeposito" runat="server" CssClass="TextBoxsPequeno" />
                                    </td>

                                    <td>
                                        <asp:Label ID="lblObsDespesas" runat="server" Text="OBS:" />
                                    </td>
                                    <td>
                                        <asp:TextBox ID="txtObsDespesas" runat="server" CssClass="TextBoxsPequeno" />
                                    </td>
                                    <td>
                                        <asp:Label ID="lblObsImpostos" runat="server" Text="OBS:" />
                                    </td>
                                    <td>
                                        <asp:TextBox ID="txtObsImpostos" runat="server" CssClass="TextBoxsPequeno" />
                                    </td>
                                    <td>
                                        <asp:Label ID="lblObsDescontos" runat="server" Text="OBS:" />
                                    </td>
                                    <td>
                                        <asp:TextBox ID="txtObsDescontos" runat="server" CssClass="TextBoxsPequeno" />
                                    </td>
                                    <td>
                                        <asp:Label ID="lblObsComissoes" runat="server" Text="OBS:" />
                                    </td>
                                    <td>
                                        <asp:TextBox ID="txtObsComissoes" runat="server" CssClass="TextBoxsPequeno" />
                                    </td>
                                    <td>
                                        <asp:Label ID="lblDespesas" runat="server" Text="Despesas(+):" />
                                    </td>

                                    <td>
                                        <asp:TextBox ID="txtDespesas" runat="server" CssClass="TextBoxsPequeno" />
                                        <asp:RegularExpressionValidator ID="ReDespesas" runat="server" ErrorMessage="*" CssClass="MsgErro" ControlToValidate="txtDespesas" ToolTip="Somente valores numericos" ValidationExpression="^[+-]?[0-9]{1,3}(?:[0-9]*(?:[.,][0-9]{2})?|(?:,[0-9]{3})*(?:\.[0-9]{2})?|(?:\.[0-9]{3})*(?:,[0-9]{2})?)$"></asp:RegularExpressionValidator>
                                    </td>
                                </tr>
                            </table>




                        </ContentTemplate>
                    </asp:UpdatePanel>
                </div>

                <div id="tabs-2" style="float: left">
                    <asp:UpdatePanel runat="server" ID="UpdatePanel1">
                        <ContentTemplate>
                            <div class="tabConferencia">
                                <div class="Consulta radius">
                                    <asp:TextBox ID="txtServico_id" runat="server"  style="display:none"></asp:TextBox>
                                    <asp:TextBox ID="txtTabela" runat="server"  style="display:none"></asp:TextBox>
                                    <asp:TextBox ID="txtCambioConferencia" runat="server"  style="display:none"></asp:TextBox>
                                    <asp:TextBox ID="txtValorTotal" runat="server"  style="display:none"></asp:TextBox>
                                    <asp:TextBox ID="txtIndexPai" runat="server"  style="display:none"></asp:TextBox>
                                    <table id="esquerda">
                                        <tr>
                                            <td>
                                                <asp:Label ID="lblSupplierConferencia" runat="server" Text="Supplier:" />
                                            </td>
                                            <td colspan="2">
                                                <asp:TextBox ID="txtSupplierConferencia" runat="server" Width="425" />
                                                <img id="processing3" alt="load" style="visibility: hidden" src="../../images/ajax-loader.gif" />

                                                <asp:Button ID="btnFiltroNomeSupplierConferencia" Style="display: none" runat="server" Text="" OnClick="btnFiltroNomeSupplierConferencia_Click" />
                                                <asp:AutoCompleteExtender
                                                    ServiceMethod="SearchSuppliers"
                                                    MinimumPrefixLength="1"
                                                    CompletionInterval="100"
                                                    EnableCaching="False"
                                                    TargetControlID="txtSupplierConferencia"
                                                    OnClientPopulating="ShowIcon3"
                                                    OnClientPopulated="ShowIcon3"
                                                    ID="AutoCompleteExtender2" runat="server"
                                                    OnClientItemSelected="CallServerSupplierConferencia"
                                                    DelimiterCharacters=""
                                                    Enabled="True">
                                                </asp:AutoCompleteExtender>

                                                <asp:TextBox ID="txtSupplierConferencia_id" runat="server"  style="display:none"></asp:TextBox>

                                            </td>

                                        </tr>
                                        <tr>
                                            <td>
                                                <asp:Label ID="lblInvoiceConferencia" runat="server" Text="Número da Fatura:" />
                                            </td>
                                            <td>
                                                <asp:TextBox ID="txtInvoiceConferencia" runat="server" onkeyup="SetKeySupplierConferencia()" />
                                                <asp:Button ID="btnFiltroNumeroFaturaConferencia" Style="display: none" runat="server" Text="" OnClick="btnFiltroNumeroFaturaConferencia_Click" />
                                                <asp:AutoCompleteExtender
                                                    ServiceMethod="SearchFaturaConferencia"
                                                    MinimumPrefixLength="1"
                                                    CompletionInterval="100"
                                                    EnableCaching="False"
                                                    TargetControlID="txtInvoiceConferencia"
                                                    ID="AutoCompleteExtender3" runat="server"
                                                    OnClientItemSelected="CallServerFaturaConferencia"
                                                    DelimiterCharacters=""
                                                    Enabled="True" UseContextKey="true">
                                                </asp:AutoCompleteExtender>

                                                <asp:TextBox ID="txtInvoiceConferencia_id" runat="server"  style="display:none"></asp:TextBox>

                                                <asp:Label ID="lblTotalFatura" runat="server" Text="Total Fatura:" />
                                                <asp:TextBox ID="txtTotalFatura" runat="server" Width="158" ReadOnly="true" />
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <asp:Label ID="lblFileNbr" runat="server" Text="File Nbr:" />
                                            </td>
                                            <td>
                                                <asp:TextBox ID="txtFileNbr" runat="server" onkeyup="SetKeyInvoiceConferencia()" />
                                                <asp:Button ID="btnFiltroFileNbr" Style="display: none" runat="server" Text="" OnClick="btnFiltroFileNbr_Click" />
                                                <asp:AutoCompleteExtender
                                                    ServiceMethod="SearchFile"
                                                    MinimumPrefixLength="1"
                                                    CompletionInterval="100"
                                                    EnableCaching="False"
                                                    TargetControlID="txtFileNbr"
                                                    ID="AutoCompleteExtender4" runat="server"
                                                    OnClientItemSelected="CallServerFile"
                                                    DelimiterCharacters=""
                                                    Enabled="True" UseContextKey="true">
                                                </asp:AutoCompleteExtender>

                                                <asp:TextBox ID="txtFileNbr_id" runat="server"  style="display:none"></asp:TextBox>

                                                <asp:Label ID="lblSaldoConferir" runat="server" Text="Saldo a Conferir:" />
                                                <asp:TextBox ID="txtSaldoConferir" runat="server" ReadOnly="true" Width="135" />

                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <asp:Label ID="lblData" runat="server" Text="Data:" />
                                            </td>
                                            <td>
                                                <asp:TextBox ID="dtData" runat="server" CssClass="TextBoxsPequeno" />
                                                <asp:Label ID="lblTodasFaturas" Text="Todas Faturas: " runat="server" />
                                                <asp:CheckBox ID="ckTodasFaturas" Text="" runat="server" />
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <asp:Label ID="lblPax" runat="server" Text="Pax:" />
                                            </td>
                                            <td>
                                                <asp:TextBox ID="txtPax" runat="server" Width="345" ReadOnly="true" />
                                            </td>
                                        </tr>
                                        <tr>
                                            <td colspan="2">
                                                <asp:Label ID="lblCambioConferencia" runat="server" Text="Cambio Conferencia: " />
                                            </td>
                                        </tr>
                                    </table>
                                    <table id="direita">
                                        <tr>
                                            <td>
                                                <asp:Label ID="lblObsOperador" runat="server" Text="Obs. Operador:" />
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <asp:TextBox ID="txtObsOperador" MaxLength="250" runat="server" Width="543px" TextMode="MultiLine" />
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <asp:Label ID="lblObsConferencia" runat="server" Text="Obs. Conferencia:" />
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <asp:TextBox ID="txtObsConferencia" MaxLength="250" runat="server" Width="543px" TextMode="MultiLine" OnTextChanged="txtObsConferencia_TextChanged" AutoPostBack="true" />
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <asp:Label ID="lblConferenciaMultipla" runat="server" Text="Valor: " />
                                                <asp:TextBox ID="txtConferenciaMultiplaValor" runat="server" Width="135" />
                                                <asp:Button ID="btnConferenciaMultipla" runat="server" Text="Conferencia Multipla" CssClass="btnGeralAzul" OnClick="btnConferenciaMultipla_Click" />
                                                <asp:Button ID="btnNovaConferencia" runat="server" Text="Nova Conferencia" CssClass="btnGeralAzul" OnClick="btnNovaConferencia_Click" />
                                            </td>

                                        </tr>

                                    </table>
                                </div>
                                <div class="Tarifas">

                                    <fieldset style="border-radius: 10px; height: 500px; width: 1266px;">

                                        <legend>
                                            <h3>Serviços</h3>
                                        </legend>
                                        <div class="CadBox_grid">
                                            <table>
                                                <tr>
                                                    <td>
                                                        <asp:UpdatePanel ID="UpdatePanel2" runat="server">
                                                            <ContentTemplate>
                                                                <asp:GridView ID="GridCadPais" runat="server" AlternatingRowStyle-CssClass="alt" AutoGenerateColumns="False" CssClass="mGrid" DataKeyNames="id, Tabela, index" GridLines="None" OnRowDataBound="OnRowDataBound" PagerStyle-CssClass="pgr">
                                                                    <AlternatingRowStyle CssClass="alt" />
                                                                    <Columns>
                                                                        <asp:TemplateField>
                                                                            <ItemTemplate>
                                                                                <a href="JavaScript:divexpandcollapse('div<%# Eval("id") %>');">
                                                                                    <img id='imgdiv<%# Eval("id") %>' width="15px" border="0"
                                                                                        src="../../images/plus-small.png" alt="" />
                                                                                </a>
                                                                            </ItemTemplate>
                                                                            <ItemStyle VerticalAlign="Middle" Width="20px" />
                                                                        </asp:TemplateField>
                                                                        <asp:TemplateField HeaderText="PC">
                                                                            <ItemTemplate>
                                                                                <asp:CheckBox ID="chkStatus" runat="server" AutoPostBack="true" Checked='<%# Convert.ToBoolean(Eval("ftc")) %>' OnCheckedChanged="chkStatus_CheckedChanged" />
                                                                            </ItemTemplate>
                                                                        </asp:TemplateField>
                                                                        <asp:TemplateField HeaderText="Valor Conferir">
                                                                            <ItemTemplate>
                                                                                <asp:TextBox ID="txtValorConferir" runat="server" AutoPostBack="true" OnTextChanged="txtValorConferir_TextChanged" Style="text-align: right" />
                                                                            </ItemTemplate>
                                                                        </asp:TemplateField>
                                                                        <asp:BoundField DataField="NomeServico" HeaderText="Serviço" ItemStyle-Width="300" />
                                                                        <asp:BoundField DataField="DataFrom" HeaderText="Data From" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="100" />
                                                                        <asp:BoundField DataField="DataTo" HeaderText="Data To" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="100" />
                                                                        <asp:BoundField DataField="SuppPayingPax" HeaderText="Paying Pax" ItemStyle-HorizontalAlign="Center" />
                                                                        <asp:BoundField DataField="Moeda" HeaderText="Moeda Lançamento" ItemStyle-HorizontalAlign="Right" />
                                                                        <asp:BoundField DataField="Total" DataFormatString="{0:F}" HeaderText="Total" HtmlEncode="false" ItemStyle-HorizontalAlign="Right" />
                                                                        <asp:BoundField DataField="DataI" HeaderText="Data In" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="100" />
                                                                        <asp:BoundField DataField="DataO" HeaderText="Data Out" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="100" />
                                                                        <asp:BoundField DataField="id" FooterStyle-CssClass="invisible" HeaderStyle-CssClass="invisible" ItemStyle-CssClass="invisible" />
                                                                        <asp:BoundField DataField="Tabela" FooterStyle-CssClass="invisible" HeaderStyle-CssClass="invisible" ItemStyle-CssClass="invisible" />
                                                                        <asp:BoundField DataField="index" FooterStyle-CssClass="invisible" HeaderStyle-CssClass="invisible" HeaderText="Index" ItemStyle-CssClass="invisible" />
                                                                        <asp:BoundField DataField="Cambio" FooterStyle-CssClass="invisible" HeaderStyle-CssClass="invisible" HeaderText="Cambio" ItemStyle-CssClass="invisible" ItemStyle-HorizontalAlign="Right" />
                                                                        <asp:BoundField DataField="SaldoConferir" DataFormatString="{0:F}" HeaderText="Saldo a Conferir" HtmlEncode="false" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="100" />
                                                                        <asp:BoundField DataField="CambioConferencia" DataFormatString="{0:F}" HeaderText="Cambio Conferencia" HtmlEncode="false" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="100" />
                                                                        <asp:TemplateField HeaderText="Desconferido">
                                                                            <ItemTemplate>
                                                                                <asp:CheckBox ID="cancelado" runat="server" AutoPostBack="true" OnCheckedChanged="cancelado_CheckedChanged" />
                                                                            </ItemTemplate>
                                                                        </asp:TemplateField>
                                                                        <asp:TemplateField>
                                                                            <ItemTemplate>
                                                                                <asp:CheckBox ID="conferenciaMultipla" runat="server" />
                                                                            </ItemTemplate>
                                                                        </asp:TemplateField>


                                                                        <asp:TemplateField>
                                                                            <ItemTemplate>
                                                                                <tr>
                                                                                    <td colspan="100%">
                                                                                        <asp:UpdatePanel ID="UpdatePanel2" runat="server">
                                                                                            <ContentTemplate>
                                                                                                <div id='div<%# Eval("id") %>' style="overflow: auto; display: none; position: relative; left: 15px; overflow: auto">
                                                                                                    <asp:GridView ID="gvOrders" runat="server" AutoGenerateColumns="false" GridLines="None" Width="95%">
                                                                                                        <Columns>

                                                                                                            <asp:TemplateField HeaderText="USD">
                                                                                                                <ItemTemplate>
                                                                                                                    <asp:TextBox ID="txtUsd" runat="server" AutoPostBack="true" Enabled="false" OnTextChanged="txtUsd_TextChanged" Style="text-align: right" Width="99%" />
                                                                                                                </ItemTemplate>
                                                                                                            </asp:TemplateField>
                                                                                                            <asp:TemplateField HeaderText="R$">
                                                                                                                <ItemTemplate>
                                                                                                                    <asp:TextBox ID="txtReais" runat="server" AutoPostBack="true" Enabled="false" OnTextChanged="txtReais_TextChanged" Style="text-align: right" Width="99%" />
                                                                                                                </ItemTemplate>
                                                                                                            </asp:TemplateField>
                                                                                                            <asp:TemplateField HeaderText="Cambio Conferencia">
                                                                                                                <ItemTemplate>
                                                                                                                    <asp:Label ID="lblCambio" runat="server" DataFormatString="{0:F}" Enabled="false" HtmlEncode="false" Style="text-align: right" />
                                                                                                                </ItemTemplate>
                                                                                                            </asp:TemplateField>
                                                                                                            <asp:BoundField DataField="index" FooterStyle-CssClass="invisible" HeaderStyle-CssClass="invisible" HeaderText="ID" ItemStyle-CssClass="invisible" />
                                                                                                            <asp:BoundField DataField="id" FooterStyle-CssClass="invisible" HeaderStyle-CssClass="invisible" HeaderText="ID" ItemStyle-CssClass="invisible" />
                                                                                                            <asp:BoundField DataField="tabela" FooterStyle-CssClass="invisible" HeaderStyle-CssClass="invisible" HeaderText="Tabela" ItemStyle-CssClass="invisible" />
                                                                                                            <asp:BoundField DataField="idServico" FooterStyle-CssClass="invisible" HeaderStyle-CssClass="invisible" HeaderText="Id Serviço" ItemStyle-CssClass="invisible" />
                                                                                                            <asp:BoundField DataField="modo" FooterStyle-CssClass="invisible" HeaderStyle-CssClass="invisible" HeaderText="Modo" ItemStyle-CssClass="invisible" />
                                                                                                            <asp:BoundField DataField="indexPai" FooterStyle-CssClass="invisible" HeaderStyle-CssClass="invisible" HeaderText="Modo" ItemStyle-CssClass="invisible" />
                                                                                                            <asp:BoundField DataField="tipo_conferencia" HeaderText="Tipo Lançamento" />
                                                                                                            <asp:BoundField DataField="data" />
                                                                                                            <asp:BoundField DataField="login" />

                                                                                                            <asp:TemplateField HeaderText="Desconferir">
                                                                                                                <ItemTemplate>
                                                                                                                    <asp:CheckBox ID="status" runat="server" AutoPostBack="true" OnCheckedChanged="status_CheckedChanged" />
                                                                                                                </ItemTemplate>
                                                                                                            </asp:TemplateField>
                                                                                                        </Columns>
                                                                                                    </asp:GridView>
                                                                                                </div>
                                                                                            </ContentTemplate>
                                                                                        </asp:UpdatePanel>
                                                                                        </div>
                                                                                    </td>
                                                                                </tr>
                                                                            </ItemTemplate>
                                                                        </asp:TemplateField>
                                                                    </Columns>
                                                                </asp:GridView>
                                                            </ContentTemplate>
                                                        </asp:UpdatePanel>
                                                    </td>
                                                </tr>
                                            </table>
                                        </div>

                                        <asp:Button ID="btnConfirmarDesconferencia_fake" runat="server" Style="display: none" />


                                        <asp:Panel ID="painelModalConfirmarDesconferencia" runat="server" CssClass="ModalPopup" Style="display: none; width: auto; height: auto; overflow-x: hidden; overflow-y: auto; border-radius: 5px;">
                                            <table>
                                                <tr>
                                                    <td>
                                                        <asp:Label ID="lblPerguntaDesconferir" Text="Deseja desconferir este File?" runat="server"></asp:Label></td>
                                                </tr>
                                                <tr>
                                                    <td>
                                                        <asp:Button ID="btnFecharPainelModalConfirmarDesconferencia" runat="server" CssClass="btnGeralAzul" Text="Cancelar" />
                                                        <asp:Button ID="btnConfirmaDesconferencia" runat="server" CssClass="btnGeralAzul" OnClick="btnConfirmaDesconferencia_Click" Text="Confirmar" />
                                                    </td>
                                                </tr>
                                            </table>
                                        </asp:Panel>

                                        <asp:ModalPopupExtender
                                            ID="modalPopupExtenderConfirmarDesconferencia"
                                            runat="server"
                                            BackgroundCssClass="ModalPopupBG"
                                            CancelControlID="btnFecharPainelModalConfirmarDesconferencia"
                                            DropShadow="false"
                                            Enabled="True"
                                            PopupControlID="painelModalConfirmarDesconferencia"
                                            PopupDragHandleControlID="PopupHeader"
                                            RepositionMode="RepositionOnWindowResizeAndScroll"
                                            Drag="true"
                                            TargetControlID="btnConfirmarDesconferencia_fake">
                                        </asp:ModalPopupExtender>

                                    </fieldset>
                                </div>
                            </div>
                        </ContentTemplate>
                    </asp:UpdatePanel>
                </div>

                <div id="tabs-3" style="float: left">
                    <asp:UpdatePanel runat="server" ID="UpdatePanel4">
                        <ContentTemplate>
                            <div class="ConsultaIncluir radius" style="width: 750px">
                                <table>

                                    <tr>

                                        <td>
                                            <asp:Label ID="lblBancoPagamento" runat="server" Text="Banco:" />
                                        </td>
                                        <td>
                                            <asp:TextBox ID="txtBancoPagamento" runat="server" Width="200" Enabled="false" />
                                            <img id="Img1" alt="load" style="visibility: hidden" src="../../images/ajax-loader.gif" />

                                            <asp:Button ID="btnFiltroBanco" Style="display: none" runat="server" Text="" OnClick="btnFiltroBanco_Click" />
                                            <asp:AutoCompleteExtender
                                                ServiceMethod="SearchBanco"
                                                MinimumPrefixLength="1"
                                                CompletionInterval="100"
                                                EnableCaching="False"
                                                TargetControlID="txtBancoPagamento"
                                                OnClientPopulating="ShowIcon"
                                                OnClientPopulated="ShowIcon"
                                                ID="AutoCompleteExtender5" runat="server"
                                                OnClientItemSelected="CallServerBanco"
                                                DelimiterCharacters=""
                                                Enabled="True">
                                            </asp:AutoCompleteExtender>
                                        </td>

                                        <td>
                                            <asp:Label ID="lblAgenciaPagamento" runat="server" Text="Agencia:" />
                                        </td>
                                        <td>
                                            <asp:TextBox ID="txtAgenciaPagamento" runat="server" Width="100" Enabled="false" />
                                            <img id="Img2" alt="load" style="visibility: hidden" src="../../images/ajax-loader.gif" />

                                            <asp:Button ID="btnFiltroAgencia" Style="display: none" runat="server" Text="" OnClick="btnFiltroAgencia_Click" />
                                            <asp:AutoCompleteExtender
                                                ServiceMethod="SearchAgencia"
                                                MinimumPrefixLength="1"
                                                CompletionInterval="100"
                                                EnableCaching="False"
                                                TargetControlID="txtAgenciaPagamento"
                                                OnClientPopulating="ShowIcon"
                                                OnClientPopulated="ShowIcon"
                                                ID="AutoCompleteExtender6" runat="server"
                                                OnClientItemSelected="CallServerAgencia"
                                                DelimiterCharacters=""
                                                Enabled="True">
                                            </asp:AutoCompleteExtender>
                                        </td>

                                        <td>
                                            <asp:Label ID="lblContaPagamento" runat="server" Text="Conta:" />
                                        </td>
                                        <td>
                                            <asp:TextBox ID="txtContaPagamento" runat="server" Width="100" OnTextChanged="txtContaPagamento_TextChanged" />
                                            <img id="Img3" alt="load" style="visibility: hidden" src="../../images/ajax-loader.gif" />

                                            <asp:Button ID="btnFiltroConta" Style="display: none" runat="server" Text="" OnClick="btnFiltroConta_Click" />
                                            <asp:AutoCompleteExtender
                                                ServiceMethod="SearchConta"
                                                MinimumPrefixLength="1"
                                                CompletionInterval="100"
                                                EnableCaching="False"
                                                TargetControlID="txtContaPagamento"
                                                OnClientPopulating="ShowIcon"
                                                OnClientPopulated="ShowIcon"
                                                ID="AutoCompleteExtender7" runat="server"
                                                OnClientItemSelected="CallServerConta"
                                                DelimiterCharacters=""
                                                Enabled="True">
                                            </asp:AutoCompleteExtender>

                                            <asp:TextBox ID="txtContaPagamento_id" runat="server"  style="display:none"></asp:TextBox>

                                        </td>
                                    </tr>

                                    <tr>
                                        <td>
                                            <asp:Label ID="lblDataInicial" runat="server" Text="Data Inicial:" />
                                        </td>
                                        <td>
                                            <asp:TextBox ID="txtDataInicial" runat="server" CssClass="TextBoxsPequeno" />
                                        </td>

                                        <td>
                                            <asp:Label ID="lblDataFinal" runat="server" Text="Data Final:" />
                                        </td>
                                        <td>
                                            <asp:TextBox ID="txtDataFinal" runat="server" CssClass="TextBoxsPequeno" />
                                        </td>

                                        <td colspan="2">
                                            <asp:Button ID="btnMostrarFaturas" runat="server" Text="Mostrar Faturas" CssClass="btnGeralAzul" OnClick="btnMostrarFaturas_Click" />
                                        </td>
                                    </tr>

                                </table>
                            </div>


                            <fieldset style="border-radius: 10px; width: auto;">
                                <legend>
                                    <caption>
                                        <h3>Pagamento</h3>
                                    </caption>
                                </legend>
                                <caption>
                                    <table>
                                        <tr>
                                            <td>
                                                <asp:Label ID="lblTipoPagamento" runat="server" Text="Tipo de Pagamento:" />
                                            </td>
                                            <td>
                                                <asp:RadioButtonList ID="rdTipoPagamento" runat="server" RepeatDirection="Horizontal">
                                                    <asp:ListItem Text="Cheque" Value="cheque" />
                                                    <asp:ListItem Text="TED" Value="ted" />
                                                    <asp:ListItem Text="DOC" Value="doc" />
                                                    <asp:ListItem Text="Transferencia" Value="transferencia" />
                                                    <asp:ListItem Text="Boleto" Value="boleto" />
                                                </asp:RadioButtonList>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <asp:Label ID="lblTotValorPagarBaixaFatura" runat="server" Text="Valor Total a Pagar:" />
                                            </td>
                                            <td>
                                                <asp:TextBox ID="txtValorTotalPagarBaixaFatura" runat="server" CssClass="TextBoxsPequeno" Enabled="false" />
                                                <asp:Button ID="btnPagarBaixaFatura" runat="server" CssClass="btnGeralAzul" OnClick="btnPagarBaixaFatura_Click" Text="Pagar Faturas" />
                                                <asp:Button ID="btnPagarBaixaFaturaTotalizar" runat="server" CssClass="btnGeralAzul" OnClick="btnPagarBaixaFaturaTotalizar_Click" Text="Totalizar" />
                                                <asp:Button ID="btnPagarBaixaFatura_fake" runat="server" Style="display: none" />


                                                <asp:Panel ID="painelModalConfirmarBaixaFaturas" runat="server" CssClass="ModalPopup" Style="display: none; width: auto; height: auto; overflow-x: hidden; overflow-y: auto; border-radius: 5px;">
                                                    <asp:ImageButton ID="btnFecharPainelModalConfirmarBaixaFaturas" ToolTip="Fechar" runat="server" ImageUrl="../../images/Icones/close2.png" Width="20px" Height="20px" />

                                                    <asp:Label ID="lblDataPagamentoPagarFatura" runat="server" Text="Data Pagamento:" />
                                                    <asp:TextBox ID="txtDataPagamentoPagarFatura" runat="server" CssClass="TextBoxsPequeno" />
                                                    <asp:Label ID="lblNumeroDoChequeBaixaFatura" runat="server" Text="Numero do Cheque:" />
                                                    <asp:TextBox ID="txtNumeroDoChequeBaixaFatura" runat="server" CssClass="TextBoxsPequeno" />
                                                    <asp:Button ID="btnConfirmaPagarBaixaFatura" runat="server" CssClass="btnGeralAzul" OnClick="btnConfirmaPagarBaixaFatura_Click" Text="Pagar Faturas" />
                                                </asp:Panel>

                                                <asp:ModalPopupExtender
                                                    ID="modalPopupExtenderConfirmarBaixaFatura"
                                                    runat="server"
                                                    BackgroundCssClass="ModalPopupBG"
                                                    CancelControlID="btnFecharPainelModalConfirmarBaixaFaturas"
                                                    DropShadow="false"
                                                    Enabled="True"
                                                    PopupControlID="painelModalConfirmarBaixaFaturas"
                                                    PopupDragHandleControlID="PopupHeader"
                                                    RepositionMode="RepositionOnWindowResizeAndScroll"
                                                    Drag="true"
                                                    TargetControlID="btnPagarBaixaFatura_fake">
                                                </asp:ModalPopupExtender>

                                            </td>
                                        </tr>

                                        <tr>
                                            <td></td>
                                            <td></td>
                                        </tr>
                                </caption>
                                </table>
                            </fieldset>





                            <fieldset style="border-radius: 10px; width: auto;">
                                <legend>
                                    <caption>
                                        <h3>Faturas</h3>
                                    </caption>
                                </legend>

                                <div style="width: auto">
                                    <asp:GridView ID="gridPagarFaturas" runat="server" CssClass="mGrid" AutoGenerateColumns="false" GridLines="None">
                                        <AlternatingRowStyle CssClass="alt" />
                                        <Columns>

                                            <asp:BoundField DataField="Fatura_numero" HeaderText="Numero da Fatura" ItemStyle-Width="300" />
                                            <asp:BoundField DataField="Fatura_Vencimento" HeaderText="Data Vencimento" ItemStyle-Width="300" DataFormatString="{0:dd/MM/yyyy}" HtmlEncode="false" />
                                            <asp:BoundField DataField="Supplier.S_razaosocial" HeaderText="Fornecedor" ItemStyle-Width="600" />
                                            <asp:BoundField DataField="Fatura_VlrTotPagar" HeaderText="Valor Total" ItemStyle-Width="300" />
                                            <asp:BoundField DataField="Fatura_Valor_Conferir" FooterStyle-CssClass="invisible" HeaderStyle-CssClass="invisible" HeaderText="Modo" ItemStyle-CssClass="invisible" />

                                            <asp:BoundField DataField="C_CentroCusto.CentroCusto_nome" HeaderText="Centro de Custo" ItemStyle-Width="300" />

                                            <asp:TemplateField HeaderText="Destinatario" ItemStyle-Width="50">
                                                <ItemTemplate>
                                                    <asp:TextBox ID="txtGridPagarFaturasDestinatario" runat="server" />
                                                </ItemTemplate>
                                            </asp:TemplateField>

                                            <asp:TemplateField HeaderText="Conferencia" ItemStyle-Width="50">
                                                <ItemTemplate>
                                                    <asp:TextBox ID="txtGridPagarFaturasConferencia" runat="server" Style="text-align: right" Enabled="false" />
                                                </ItemTemplate>
                                            </asp:TemplateField>

                                            <asp:TemplateField HeaderText="Pagar" ItemStyle-Width="50">
                                                <ItemTemplate>
                                                    <asp:CheckBox ID="chkGridPagarFaturaConferencia" runat="server" AutoPostBack="true" OnCheckedChanged="chkGridPagarFaturaConferencia_CheckedChanged" />
                                                </ItemTemplate>
                                            </asp:TemplateField>

                                            <asp:BoundField DataField="Fatura_id" FooterStyle-CssClass="invisible" HeaderStyle-CssClass="invisible" HeaderText="Modo" ItemStyle-CssClass="invisible" />
                                            <asp:BoundField DataField="Fatura_VlrTotServ" FooterStyle-CssClass="invisible" HeaderStyle-CssClass="invisible" HeaderText="Modo" ItemStyle-CssClass="invisible" />
                                            <asp:BoundField DataField="Supplier.S_razaosocial" FooterStyle-CssClass="invisible" HeaderStyle-CssClass="invisible" HeaderText="Fornecedor" ItemStyle-CssClass="invisible" />
                                            <asp:BoundField DataField="C_CentroCusto.CentroCusto_id" FooterStyle-CssClass="invisible" HeaderStyle-CssClass="invisible" ItemStyle-CssClass="invisible" />
                                        </Columns>
                                    </asp:GridView>
                                </div>

                            </fieldset>


                            <fieldset style="border-radius: 10px; width: auto;">
                                <legend>
                                    <caption>
                                        <h3>Sumario</h3>
                                    </caption>
                                </legend>

                                <div style="width: auto">
                                    <asp:GridView ID="gridPagarFaturasSumario" runat="server" CssClass="mGrid" AutoGenerateColumns="false" GridLines="None">
                                        <AlternatingRowStyle CssClass="alt" />
                                        <Columns>

                                            <asp:BoundField DataField="nome" HeaderText="Fornecedor" HtmlEncodeFormatString="true" />
                                            <asp:BoundField DataField="valor" HeaderText="Valor Total" />

                                        </Columns>
                                    </asp:GridView>
                                </div>
                            </fieldset>


                        </ContentTemplate>
                    </asp:UpdatePanel>
                </div>

                <div id="tabs-4" style="float: left">
                    <asp:UpdatePanel runat="server" ID="UpdatePanel5">
                        <Triggers>
                            <asp:PostBackTrigger ControlID="btnGerarRelatorioPainelModalRelatorioConciliacao" />
                        </Triggers>
                        <ContentTemplate>

                            <asp:TextBox ID="txtFaturaConciliacao_id" runat="server"  style="display:none"></asp:TextBox>
                            <asp:TextBox ID="txtTabelaConciliacao_id" runat="server"  style="display:none"></asp:TextBox>

                            <div class="ConsultaIncluir radius" style="width: auto">
                                <table>
                                    <tr>
                                        <td>
                                            <asp:Label ID="lblBancoConciliacao" runat="server" Text="Banco:" />
                                        </td>
                                        <td>
                                            <asp:TextBox ID="txtBancoConciliacao" runat="server" Width="200" Enabled="false" />
                                            <img id="Img4" alt="load" style="visibility: hidden" src="../../images/ajax-loader.gif" />

                                            <asp:Button ID="btnFiltroBancoConciliacao" Style="display: none" runat="server" Text="" OnClick="btnFiltroBancoConciliacao_Click" />
                                            <asp:AutoCompleteExtender
                                                ServiceMethod="SearchBancoConciliacao"
                                                MinimumPrefixLength="1"
                                                CompletionInterval="100"
                                                EnableCaching="False"
                                                TargetControlID="txtBancoConciliacao"
                                                OnClientPopulating="ShowIcon"
                                                OnClientPopulated="ShowIcon"
                                                ID="AutoCompleteExtender8" runat="server"
                                                OnClientItemSelected="CallServerBancoConciliacao"
                                                DelimiterCharacters=""
                                                Enabled="True">
                                            </asp:AutoCompleteExtender>
                                        </td>

                                        <td>
                                            <asp:Label ID="lblAgenciaConciliacao" runat="server" Text="Agencia:" />
                                        </td>
                                        <td>
                                            <asp:TextBox ID="txtAgenciaConciliacao" runat="server" Width="100" Enabled="false" />
                                            <img id="Img5" alt="load" style="visibility: hidden" src="../../images/ajax-loader.gif" />

                                            <asp:Button ID="btnFiltroAgenciaConciliacao" Style="display: none" runat="server" Text="" OnClick="btnFiltroAgenciaConciliacao_Click" />
                                            <asp:AutoCompleteExtender
                                                ServiceMethod="SearchAgenciaConciliacao"
                                                MinimumPrefixLength="1"
                                                CompletionInterval="100"
                                                EnableCaching="False"
                                                TargetControlID="txtAgenciaConciliacao"
                                                OnClientPopulating="ShowIcon"
                                                OnClientPopulated="ShowIcon"
                                                ID="AutoCompleteExtender9" runat="server"
                                                OnClientItemSelected="CallServerAgenciaConciliacao"
                                                DelimiterCharacters=""
                                                Enabled="True">
                                            </asp:AutoCompleteExtender>
                                        </td>

                                        <td>
                                            <asp:Label ID="lblContaConciliacao" runat="server" Text="Conta:" />
                                        </td>
                                        <td>
                                            <asp:TextBox ID="txtContaConciliacao" runat="server" Width="100" OnTextChanged="txtContaConciliacao_TextChanged" />
                                            <img id="Img6" alt="load" style="visibility: hidden" src="../../images/ajax-loader.gif" />

                                            <asp:Button ID="btnFiltroContaConciliacao" Style="display: none" runat="server" Text="" OnClick="btnFiltroContaConciliacao_Click" />
                                            <asp:AutoCompleteExtender
                                                ServiceMethod="SearchContaConciliacao"
                                                MinimumPrefixLength="1"
                                                CompletionInterval="100"
                                                EnableCaching="False"
                                                TargetControlID="txtContaConciliacao"
                                                OnClientPopulating="ShowIcon"
                                                OnClientPopulated="ShowIcon"
                                                ID="AutoCompleteExtender10" runat="server"
                                                OnClientItemSelected="CallServerContaConciliacao"
                                                DelimiterCharacters=""
                                                Enabled="True">
                                            </asp:AutoCompleteExtender>
                                        </td>
                                    </tr>


                                    <tr>
                                        <td>
                                            <asp:Label ID="lblClassificacaoContabilConciliacao" runat="server" Text="Classificação Contabil:" />
                                        </td>
                                        <td>
                                            <asp:DropDownList ID="cmbClassificacaoContabilConciliacao" runat="server" />
                                        </td>
                                        <td>
                                            <asp:Label ID="lblCentroCustoConciliacao" runat="server" Text="Centro de Custo:" />
                                        </td>
                                        <td>
                                            <asp:DropDownList ID="cmbCentroCustoConciliacao" runat="server" />
                                        </td>
                                        <td>
                                            <asp:Label ID="lblMoedaConciliacao" runat="server" Text="Moeda:" />
                                        </td>
                                        <td>
                                            <asp:DropDownList ID="cmbMoedaConciliacao" runat="server" />
                                        </td>
                                    </tr>


                                    <tr>
                                        <td>
                                            <asp:Label ID="lblDataConciliacao" runat="server" Text="Data:" />
                                        </td>
                                        <td>
                                            <asp:TextBox ID="txtDataConciliacao" runat="server" OnTextChanged="txtDataConciliacao_TextChanged" AutoPostBack="true" />
                                        </td>

                                        <td>
                                            <asp:Label ID="lblValorConciliacao" runat="server" Text="Valor:" />
                                        </td>
                                        <td>
                                            <asp:TextBox ID="txtValorConciliacao" runat="server" />
                                        </td>



                                    </tr>


                                    <tr>
                                        <td>
                                            <asp:Label ID="lblHistoricoConciliacao" runat="server" Text="Historico:" />
                                        </td>
                                        <td colspan="3">
                                            <asp:TextBox ID="txtHistoricoConciliacao" MaxLength="1000" runat="server" Height="50" Width="750px" TextMode="MultiLine" />
                                        </td>

                                        <td>
                                            <asp:RadioButtonList ID="rdButtonTipoLancamento" runat="server">
                                                <asp:ListItem Text="Débito" Value="debito" />
                                                <asp:ListItem Text="Crédito" Value="credito" />
                                            </asp:RadioButtonList>
                                        </td>

                                        <td>
                                            <asp:Button ID="btnSalvarConciliacao" runat="server" Text="Salvar" CssClass="btnGeralAzul" OnClick="btnSalvarConciliacao_Click" />
                                            <asp:Button ID="btnExcluirConciliacao" runat="server" Text="Excluir" CssClass="btnGeralAzul" OnClick="btnExcluirConciliacao_Click" Visible="false" />
                                            <asp:Button ID="btnAlterarConciliacao" runat="server" Text="Alterar" CssClass="btnGeralAzul" OnClick="btnAlterarConciliacao_Click" Visible="false" />
                                            <asp:Button ID="btnNovaConciliacao" runat="server" Text="Novo" CssClass="btnGeralAzul" OnClick="btnNovaConciliacao_Click" Visible="false" />

                                            <asp:Button ID="btnRelatorioConciliacao" runat="server" Text="Relatório" CssClass="btnGeralAzul" OnClick="btnRelatorioConciliacao_Click" />



                                            <asp:Button ID="btnRelatorioConciliacao_Fake" runat="server" Style="display: none" />

                                            <asp:Panel ID="painelModalRelatorioConciliacao" runat="server" CssClass="ModalPopup" Style="display: none; width: auto; height: auto; overflow-x: hidden; overflow-y: auto; border-radius: 5px;">
                                                <table>
                                                    <tr>
                                                        <td>
                                                            <asp:Label ID="lblDataInicialModalRelatorioConciliacao" Text="Data Inicial:" runat="server" />
                                                        </td>
                                                        <td>
                                                            <asp:TextBox ID="txtDataIncialModalRelatorioConciliacao" runat="server" />
                                                        </td>


                                                        <td>
                                                            <asp:Label ID="lblDataFinalModalRelatorioConciliacao" Text="Data Final:" runat="server" />
                                                        </td>
                                                        <td>
                                                            <asp:TextBox ID="txtDataFinalModalRelatorioConciliacao" runat="server" />
                                                        </td>

                                                    </tr>
                                                    <tr>
                                                        <td style="text-align: right" colspan="4">
                                                            <asp:Button ID="btnGerarRelatorioPainelModalRelatorioConciliacao" runat="server" CssClass="btnGeralAzul" OnClick="btnGerarRelatorioPainelModalRelatorioConciliacao_Click" Text="Gerar" />
                                                            <asp:Button ID="btnFecharPainelModalRelatorioConciliacao" runat="server" CssClass="btnGeralAzul" Text="Cancelar" />
                                                        </td>
                                                    </tr>
                                                </table>
                                            </asp:Panel>

                                            <asp:ModalPopupExtender
                                                ID="modalPopupExtenderRelatorioConciliacao"
                                                runat="server"
                                                BackgroundCssClass="ModalPopupBG"
                                                CancelControlID="btnFecharPainelModalRelatorioConciliacao"
                                                DropShadow="false"
                                                Enabled="True"
                                                PopupControlID="painelModalRelatorioConciliacao"
                                                PopupDragHandleControlID="PopupHeader"
                                                RepositionMode="RepositionOnWindowResizeAndScroll"
                                                Drag="true"
                                                TargetControlID="btnRelatorioConciliacao_Fake">
                                            </asp:ModalPopupExtender>


                                            <asp:Button ID="btnConfirmarExcluirFatura_fake" runat="server" Style="display: none" />

                                            <asp:Panel ID="painelModalConfirmarExcluirLancamento" runat="server" CssClass="ModalPopup" Style="display: none; width: auto; height: auto; overflow-x: hidden; overflow-y: auto; border-radius: 5px;">
                                                <table>
                                                    <tr>
                                                        <td>
                                                            <asp:Label ID="lblModalConfirmarExcluirLancamento" Text="" runat="server" />
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td style="text-align: center">
                                                            <asp:Button ID="btnConfirmarExcluirLancamento" runat="server" CssClass="btnGeralAzul" OnClick="btnConfirmarExcluirLancamento_Click" Text="Confirmar" />
                                                            <asp:Button ID="btnFecharPainelModalExcluirLancamento" runat="server" CssClass="btnGeralAzul" Text="Cancelar" />
                                                        </td>
                                                    </tr>
                                                </table>
                                            </asp:Panel>

                                            <asp:ModalPopupExtender
                                                ID="modalPopupExtenderConfirmarExcluirLancamento"
                                                runat="server"
                                                BackgroundCssClass="ModalPopupBG"
                                                CancelControlID="btnFecharPainelModalExcluirLancamento"
                                                DropShadow="false"
                                                Enabled="True"
                                                PopupControlID="painelModalConfirmarExcluirLancamento"
                                                PopupDragHandleControlID="PopupHeader"
                                                RepositionMode="RepositionOnWindowResizeAndScroll"
                                                Drag="true"
                                                TargetControlID="btnConfirmarExcluirFatura_fake">
                                            </asp:ModalPopupExtender>


                                        </td>
                                    </tr>
                                </table>

                                <table style="width: 100%">
                                    <tr>
                                        <td>
                                            <asp:GridView ID="grdConciliacao" runat="server" AlternatingRowStyle-CssClass="alt" AutoGenerateColumns="False" DataKeyNames="id, Tabela, IdConta, Grupo" OnRowDataBound="grdConciliacao_RowDataBound" CssClass="mGrid" GridLines="None" PagerStyle-CssClass="pgr" Width="100%">
                                                <AlternatingRowStyle CssClass="alt" />

                                                <Columns>

                                                    <asp:TemplateField>
                                                        <ItemTemplate>
                                                            <a href="JavaScript:divexpandcollapse('div1<%# Eval("id") %>');">
                                                                <img id='imgdiv1<%# Eval("id") %>' width="15px" border="0"
                                                                    src="../../images/plus-small.png" alt="" />
                                                            </a>
                                                        </ItemTemplate>
                                                        <ItemStyle VerticalAlign="Middle" Width="20px" />
                                                    </asp:TemplateField>

                                                    <asp:BoundField DataField="id" FooterStyle-CssClass="invisible" HeaderStyle-CssClass="invisible" HeaderText="Modo" ItemStyle-CssClass="invisible" />
                                                    <asp:BoundField DataField="Lancamento" HeaderText="Tipo de Lançamento" />
                                                    <asp:BoundField DataField="NumeroCheque" HeaderText="Numero do Cheque" FooterStyle-CssClass="invisible" HeaderStyle-CssClass="invisible" ItemStyle-CssClass="invisible" />
                                                    <asp:BoundField DataField="Historico" HeaderText="Historico" />
                                                    <asp:BoundField DataField="TipoLancamento" HeaderText="Debito/Credito" />
                                                    <asp:BoundField DataField="TipoPagamento" HeaderText="Tipo de Pagamento" />
                                                    <asp:BoundField DataField="NumeroCheque" HeaderText="Numero do Cheque" />
                                                    <asp:BoundField DataField="ValorPago" HeaderText="Valor Pago" />
                                                    <asp:BoundField DataField="valorParcial" HeaderText="Saldo" />
                                                    <asp:BoundField DataField="ord" HeaderText="Data Pagamento" FooterStyle-CssClass="invisible" HeaderStyle-CssClass="invisible" ItemStyle-CssClass="invisible" />
                                                    <asp:BoundField DataField="Tabela" HeaderText="Tabela" FooterStyle-CssClass="invisible" HeaderStyle-CssClass="invisible" ItemStyle-CssClass="invisible" />
                                                    <asp:BoundField DataField="IdConta" HeaderText="IdConta" FooterStyle-CssClass="invisible" HeaderStyle-CssClass="invisible" ItemStyle-CssClass="invisible" />
                                                    <asp:BoundField DataField="Grupo" FooterStyle-CssClass="invisible" HeaderStyle-CssClass="invisible" HeaderText="Modo" ItemStyle-CssClass="invisible" />

                                                    <asp:TemplateField>
                                                        <ItemTemplate>
                                                            <asp:LinkButton ID="EditarConciliacao" runat="server" Text="Mostrar" OnCommand="EditarConciliacao_Command" CommandArgument='<%# string.Format("{0},{1}", Eval("id"), Eval("Tabela")) %>' />
                                                        </ItemTemplate>
                                                    </asp:TemplateField>

                                                    <asp:TemplateField>
                                                        <ItemTemplate>
                                                            <tr>
                                                                <td colspan="100%">
                                                                    <div id='div1<%# Eval("id") %>' style="overflow: auto; display: none; position: relative; left: 15px; overflow: auto">
                                                                        <asp:GridView ID="subGrdConciliacao" runat="server" AutoGenerateColumns="false" GridLines="None" Width="95%">
                                                                            <Columns>
                                                                                <asp:BoundField DataField="Fatura_numero" HeaderText="Numero da Fatura" />
                                                                                <asp:BoundField DataField="C_ClassificacaoContabil.ClassificacaoContabil_nome" HeaderText="Classificação Contabil" />
                                                                                <asp:BoundField DataField="C_CentroCusto.CentroCusto_nome" HeaderText="Centro de Custo" />
                                                                                <asp:BoundField DataField="Fatura_VlrTotPagar" HeaderText="Valor Pago" />
                                                                            </Columns>
                                                                        </asp:GridView>
                                                                    </div>
                                                                </td>
                                                            </tr>
                                                        </ItemTemplate>
                                                    </asp:TemplateField>

                                                </Columns>
                                            </asp:GridView>

                                        </td>
                                    </tr>
                                </table>
                            </div>
                        </ContentTemplate>
                    </asp:UpdatePanel>

                </div>



                <div id="tabs-5" style="float: left">
                    <asp:UpdatePanel runat="server" ID="UpdatePanel7">
                        <Triggers>
                            <asp:PostBackTrigger ControlID="btnListarCambio" />
                        </Triggers>
                        <ContentTemplate>
                            <script type="text/javascript" language="javascript">
                                Sys.Application.add_load(jScript);
                            </script>

                            <div class="ConsultaIncluir radius" style="width: auto">
                                <table>
                                    <tr>
                                        <td>
                                            <asp:Label ID="lblDataCambio" runat="server" Text="Data:" />
                                        </td>
                                        <td>
                                            <asp:TextBox ID="txtDataCambio" runat="server" CssClass="TextBoxsPequeno" />
                                        </td>
                                        <td>
                                            <asp:Label ID="lblTipoCambio" runat="server" Text="Tipo de Cambio:" />
                                        </td>
                                        <td>
                                            <asp:DropDownList ID="cmbTipoCambio" runat="server" />
                                        </td>
                                        <td>
                                            <asp:Label ID="lblValorCambio" runat="server" Text="Valor:" />
                                        </td>
                                        <td>
                                            <asp:TextBox ID="txtValorCambio" runat="server" />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <asp:Label ID="lblMoedaCambioDe" runat="server" Text="De:" />
                                        </td>
                                        <td>
                                            <asp:DropDownList ID="cmbMoedaCambioDe" runat="server" />
                                        </td>
                                        <td>
                                            <asp:Label ID="lblMoedaCambioPara" runat="server" Text="Para:" />
                                        </td>
                                        <td>
                                            <asp:DropDownList ID="cmbMoedaCambioPara" runat="server" />
                                        </td>

                                        <td colspan="2">
                                            <asp:Label ID="lblIdCambio" runat="server" Text="" Visible="false" />
                                            <asp:Button ID="btnIncluirCambio" runat="server" Text="Incluir" CssClass="btnGeralAzul" OnClick="btnIncluirCambio_Click" />
                                            <asp:Button ID="btnExcluirCambio" runat="server" Text="Excluir" CssClass="btnGeralAzul" OnClick="btnExcluirCambio_Click" />
                                            <asp:Button ID="btnAlterarCambio" runat="server" Text="Alterar" CssClass="btnGeralAzul" OnClick="btnAlterarCambio_Click" />
                                            <asp:Button ID="btnListarCambio" runat="server" Text="Listar" CssClass="btnGeralAzul" OnClick="btnListarCambio_Click" />
                                        </td>

                                    </tr>
                                </table>

                                <asp:GridView ID="grdCambio" runat="server" AlternatingRowStyle-CssClass="alt" AutoGenerateColumns="False" CssClass="mGrid" GridLines="None" PagerStyle-CssClass="pgr" Width="100%">
                                    <AlternatingRowStyle CssClass="alt" />

                                    <Columns>
                                        <asp:BoundField DataField="Cambio_id" FooterStyle-CssClass="invisible" HeaderStyle-CssClass="invisible" ItemStyle-CssClass="invisible" />
                                        <asp:BoundField DataField="data" HeaderText="Data" DataFormatString="{0:dd/MM/yyyy}" HtmlEncode="false" />
                                        <asp:BoundField DataField="Moeda.Moeda_sigla" HeaderText="De" />
                                        <asp:BoundField DataField="Moeda1.Moeda_sigla" HeaderText="Para" />
                                        <asp:BoundField DataField="Cambio_Tipo.nome" HeaderText="Tipo de Cambio" />
                                        <asp:BoundField DataField="cambio1" HeaderText="Valor" />

                                        <asp:TemplateField HeaderText="Editar">
                                            <ItemTemplate>

                                                <asp:LinkButton ID="EditarCambio" runat="server" Text="Editar" OnCommand="EditarCambio_Command" CommandArgument='<%# string.Format("{0}", Eval("Cambio_id")) %>' />

                                            </ItemTemplate>
                                        </asp:TemplateField>

                                    </Columns>
                                </asp:GridView>


                            </div>

                        </ContentTemplate>
                    </asp:UpdatePanel>
                </div>


                <div id="tabs-6" style="float: left">
                    <asp:UpdatePanel runat="server" ID="UpdatePanel6">
                        <Triggers>
                            <asp:PostBackTrigger ControlID="btnGerarRelatorioContasPagarRelatorios" />
                            <asp:PostBackTrigger ControlID="btnGerarRelatorioRentabilidade" />
                        </Triggers>
                        <ContentTemplate>

                            <script type="text/javascript" language="javascript">
                                Sys.Application.add_load(jScript);
                            </script>



                            <fieldset style="border-radius: 10px; height: 55px;">
                                <legend>
                                    <h3>Contas a Pagar</h3>
                                </legend>
                                <div class="CadBox_grid">
                                    <table>
                                        <tr>
                                            <td>
                                                <asp:Label ID="lblDataInicialContasPagarRelatorios" runat="server" Text="Data Inicial:" />
                                            </td>
                                            <td>
                                                <asp:TextBox ID="txtDataInicialContasPagarRelatorios" runat="server" CssClass="TextBoxsPequeno" />
                                            </td>

                                            <td>
                                                <asp:Label ID="lblDataFinalContasPagarRelatorios" runat="server" Text="Data Final:" />
                                            </td>
                                            <td>
                                                <asp:TextBox ID="txtDataFinalContasPagarRelatorios" runat="server" CssClass="TextBoxsPequeno" />
                                            </td>
                                            <td>
                                                <asp:Button ID="btnGerarRelatorioContasPagarRelatorios" runat="server" Text="Gerar" CssClass="btnGeralAzul" OnClick="btnGerarRelatorioContasPagarRelatorios_Click" />
                                            </td>


                                            <td>
                                                <asp:Label ID="lblTodasAsFaturas" runat="server" Text="Mostrar Todas as Faturas:" />
                                            </td>
                                            <td>
                                                <asp:CheckBox ID="chkBoxTodasAsFaturasRelatorioContasPagar" runat="server" />
                                            </td>


                                        </tr>
                                    </table>
                                </div>
                            </fieldset>
                            <br />



                            <fieldset style="border-radius: 10px; height: 55px;">
                                <legend>
                                    <h3>Rentabilidade</h3>
                                </legend>
                                <div class="CadBox_grid">
                                    <table>
                                        <tr>
                                            <td>
                                                <asp:Label ID="lblNumeroFileRelatorios" runat="server" Text="Numero do File:" />
                                            </td>
                                            <td>
                                                <asp:TextBox ID="txtNumeroFileRelatorios" runat="server" CssClass="TextBoxsPequeno" />
                                            </td>

                                            <td>
                                                <asp:Button ID="btnGerarRelatorioRentabilidade" runat="server" Text="Gerar" CssClass="btnGeralAzul" OnClick="btnGerarRelatorioRentabilidade_Click" />
                                            </td>
                                        </tr>
                                    </table>
                                </div>
                            </fieldset>
                            <br />


                        </ContentTemplate>
                    </asp:UpdatePanel>
                </div>

                <div id="tabs-7" style="float: left">
                    <asp:UpdatePanel runat="server" ID="UpdatePanel3">
                        <Triggers>
                            <asp:PostBackTrigger ControlID="btnListarContas" />
                        </Triggers>
                        <ContentTemplate>
                            <fieldset style="border-radius: 10px; height: 55px;">

                                <legend>
                                    <h3>Banco</h3>
                                </legend>
                                <div class="CadBox_grid">
                                    <table>
                                        <tr>
                                            <td>
                                                <asp:Label ID="lblNumeroBancoTabelas" runat="server" Text="Numero:" />
                                            </td>
                                            <td>
                                                <asp:TextBox ID="txtNumeroBancoTabelas" runat="server" CssClass="TextBoxsPequeno" />
                                            </td>

                                            <td>
                                                <asp:Label ID="lblNomeBancoTabelas" runat="server" Text="Nome:" />
                                            </td>
                                            <td>
                                                <asp:TextBox ID="txtNomeBancoTabelas" runat="server" CssClass="TextBoxsPequeno" />
                                            </td>

                                            <td>
                                                <asp:Label ID="lblRazaoSocialTabelas" runat="server" Text="Razão Social:" />
                                            </td>
                                            <td>
                                                <asp:TextBox ID="txtRazaoSocialTabelas" runat="server" Width="300" />
                                            </td>
                                            <td>
                                                <asp:Button ID="btnSalvarBancoTabelas" runat="server" Text="Salvar" CssClass="btnGeralAzul" OnClick="btnSalvarBancoTabelas_Click" />
                                            </td>
                                        </tr>
                                    </table>
                                </div>
                            </fieldset>

                            <br />

                            <fieldset style="border-radius: 10px; height: 55px;">

                                <legend>
                                    <h3>Agencia</h3>
                                </legend>
                                <div class="CadBox_grid">
                                    <table>
                                        <tr>

                                            <td>
                                                <asp:Label ID="Label1" runat="server" Text="Banco:" />
                                            </td>
                                            <td>
                                                <asp:DropDownList ID="cmbNomeBanco" runat="server" />
                                            </td>

                                            <td>
                                                <asp:Label ID="lblNumeroAgenciaTabelas" runat="server" Text="Numero:" />
                                            </td>
                                            <td>
                                                <asp:TextBox ID="txtNumeroAgenciaTabelas" runat="server" CssClass="TextBoxsPequeno" />
                                            </td>

                                            <td>
                                                <asp:Label ID="lblNomeAgenciaTabelas" runat="server" Text="Nome:" />
                                            </td>
                                            <td>
                                                <asp:TextBox ID="txtNomeAgenciaTabelas" runat="server" CssClass="TextBoxsPequeno" />
                                            </td>

                                            <td>
                                                <asp:Button ID="btnSalvarAgenciaTabelas" runat="server" Text="Salvar" CssClass="btnGeralAzul" OnClick="btnSalvarAgenciaTabelas_Click" />
                                            </td>
                                        </tr>
                                    </table>
                                </div>
                            </fieldset>

                            <br />

                            <fieldset style="border-radius: 10px; height: 55px;">

                                <legend>
                                    <h3>Conta</h3>
                                </legend>
                                <div class="CadBox_grid">
                                    <table>
                                        <tr>
                                            <td>
                                                <asp:Label ID="Label4" runat="server" Text="Agencia:" />
                                            </td>
                                            <td>
                                                <asp:DropDownList ID="cmbNumeroAgencia" runat="server" />
                                            </td>

                                            <td>
                                                <asp:Label ID="lblNumeroContaTabelas" runat="server" Text="Numero:" />
                                            </td>
                                            <td>
                                                <asp:TextBox ID="txtNumeroContaTabelas" runat="server" CssClass="TextBoxsPequeno" />
                                            </td>

                                            <td>
                                                <asp:Label ID="lblNomeContaTabelas" runat="server" Text="Nome:" />
                                            </td>
                                            <td>
                                                <asp:TextBox ID="txtNomeContaTabelas" runat="server" CssClass="TextBoxsPequeno" />
                                            </td>

                                            <td>
                                                <asp:Label ID="Label5" runat="server" Text="Moeda:" />
                                            </td>
                                            <td>
                                                <asp:DropDownList ID="cmbMoedaTabelas" runat="server" />
                                            </td>

                                            <td>
                                                <asp:Button ID="btnSalvarContaTabelas" runat="server" Text="Salvar" CssClass="btnGeralAzul" OnClick="btnSalvarContaTabelas_Click" />
                                                <asp:Button ID="btnListarContas" runat="server" Text="Listar" CssClass="btnGeralAzul" OnClick="btnListarContas_Click" />
                                            </td>

                                        </tr>
                                    </table>
                                </div>
                            </fieldset>

                            <br />


                            <fieldset style="border-radius: 10px; height: 55px;">
                                <legend>
                                    <h3>Centro de Custo</h3>
                                </legend>
                                <div class="CadBox_grid">
                                    <table>
                                        <tr>
                                            <td>
                                                <asp:Label ID="lblCentroCustoTabelas" runat="server" Text="Centro de Custo:" />
                                            </td>
                                            <td>
                                                <asp:TextBox ID="txtCentroCustoTabelas" runat="server" CssClass="TextBoxsPequeno" />
                                            </td>

                                            <td>
                                                <asp:Button ID="btnSalvarCentroCusto" runat="server" Text="Salvar" CssClass="btnGeralAzul" OnClick="btnSalvarCentroCusto_Click" />
                                            </td>

                                        </tr>
                                    </table>
                                </div>
                            </fieldset>

                            <br />

                            <fieldset style="border-radius: 10px; height: 55px;">
                                <legend>
                                    <h3>Classificação Contábil</h3>
                                </legend>
                                <div class="CadBox_grid">
                                    <table>
                                        <tr>
                                            <td>
                                                <asp:Label ID="lblClassificacaoContabilTabelas" runat="server" Text="Classificação Contábil:" />
                                            </td>
                                            <td>
                                                <asp:TextBox ID="txtClassificacaoContabilTabelas" runat="server" CssClass="TextBoxsPequeno" />
                                            </td>

                                            <td>
                                                <asp:Button ID="btnSalvarClassificacaoContabil" runat="server" Text="Salvar" CssClass="btnGeralAzul" OnClick="btnSalvarClassificacaoContabil_Click" />
                                            </td>

                                        </tr>
                                    </table>
                                </div>
                            </fieldset>

                            <br />

                            <fieldset style="border-radius: 10px; height: 55px;">
                                <legend>
                                    <h3>Tipo Fatura</h3>
                                </legend>
                                <div class="CadBox_grid">
                                    <table>
                                        <tr>
                                            <td>
                                                <asp:Label ID="lblTipoFaturaTabelas" runat="server" Text="Tipo Fatura:" />
                                            </td>
                                            <td>
                                                <asp:TextBox ID="txtTipoFaturaTabelas" runat="server" CssClass="TextBoxsPequeno" />
                                            </td>

                                            <td>
                                                <asp:Button ID="btnSalvarTipoFatura" runat="server" Text="Salvar" CssClass="btnGeralAzul" OnClick="btnSalvarTipoFatura_Click" />
                                            </td>

                                        </tr>
                                    </table>
                                </div>
                            </fieldset>

                        </ContentTemplate>
                    </asp:UpdatePanel>
                </div>


            </div>
        </div>

        

        

    </form>
</body>
</html>

